Skip to content

feat(security)!: View All and Modify All stop opening fields; viewAllFields is the one every-field bit - #37371

Draft
objectstack-fleet[bot] wants to merge 13 commits into
mainfrom
claude/project-thread-o3bcge
Draft

objectstack-fleet[bot] wants to merge 13 commits into
mainfrom
claude/project-thread-o3bcge

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Alice · project thread

Fixes #36055

Blocked-by: #37314

Draft. #37314 opens the 19 migration step (step19, CONVERSIONS_BY_MAJOR[19], the semantic:19 region). When it merges, this branch merges main and adds the rest (see "Still to come"). Until then check-adr-0087-registration is red on purpose: the changeset names the conversion id that the 19 entry will register.

Maintainer quick read

  • From 19.0.0, View All (viewAllRecords) and Modify All (modifyAllRecords) widen records only. They cast no field vote. viewAllFields is the only "every field" channel: read only, never edit, and a set's own readable: false row beats it.
  • Error direction: an unconverted set sees fewer fields, never more. No hidden field opens.
  • Stored permission sets (Studio-saved) take the new meaning on upgrade, no rewrite (ruling A, comment 7177446075). Source sets get viewAllFields: true from os migrate meta --from 18 --write.
  • Beyond the card's premise: Modify All's cross-set EDIT re-open is lost too, because viewAllFields votes read only. That includes the built-in admin beside an app set's edit lock (it still reads every field). This is the ruled field-axis split (ruling 6912661484); the D3 entry will name it.

What changes

  • @objectstack/core: superuserFieldVote is replaced by viewAllFieldsReadVote(sets, object, field). buildEffectiveFieldPermissions asks it. holdsSuperuserBypass is unchanged and answers the record bypass only.
  • @objectstack/plugin-security: getFieldPermissions asks the same vote. Explain drops the "superseded by the Modify All Data field vote" branch (and ConditionedFieldEntry.supersededBy): a row-conditioned lock binds per row for every caller.
  • @objectstack/lint: security-superuser-field-mask-inert is retired (constant, catalog text, explanation, export). security-cross-set-field-reopen reports only a hidden field another set's viewAllFields re-opens, in all 11 locales. The controlled-by-parent master-reference rule and the roll-up source-visibility rules no longer skip a mask beside Modify All.
  • @objectstack/scenarios: persona-grant scoring no longer treats Modify All as overriding a field lock.
  • @objectstack/spec: viewAllRecords / modifyAllRecords / viewAllFields descriptions state the new meaning (generated reference docs regenerated). The liveness ledger anchors viewAllFields at #viewAllFieldsReadVote.
  • Showcase: showcase_auditor (four View All entries) and ops' showcase_announcement Modify All entry carry viewAllFields: true, migrated by hand.
  • Docs: field-level-security, authorization, permissions-matrix and the showcase security tour describe the 19 meaning.

Why

Card #36055, step 3 of the field-axis split (#34365, ruling of record 6912661484): View All / Modify All widen records, viewAllFields reads fields.

Still to come (after #37314 merges)

  • packages/spec/src/conversions/entries/19/permission-view-all-fields-beside-record-bypass.ts: adds viewAllFields: true to every objects entry (wildcard included) that carries viewAllRecords or modifyAllRecords without it. retiredFromLoadPath: true, registered in CONVERSIONS_BY_MAJOR[19] and step19.
  • The 19 semantic upgrade-guide entry, with the one-step check and the lint pointer.
  • Ruling A: the id refused at the artifact door (DEFAULT_FLIPS_NOT_REPLAYED_HERE, packages/metadata-core/src/artifact-forward-conversion.ts) and at stored-row reads (packages/spec/src/conversions/stored.ts), with tests.
  • Dogfood battery on the final head.

Verification

Local on 18c15ea (affected tests and the derived gate families; the rest is cited from CI on the same head):

  • vitest run: @objectstack/core src/security 75 files / 1493 tests green; @objectstack/lint 235 files green; @objectstack/plugin-security 289 files / 7277 tests green; @objectstack/scenarios scenario-tags green (its test/build and test/runner/packages failures need a packed workspace build and are untouched here); @objectstack/spec permission tests green; packages/cli/test/superuser-bypass-mirror-parity.test.ts green.
  • typecheck: core, lint, plugin-security, scenarios green.
  • @objectstack/spec check:generated green after --fix (gen:docs).
  • Green: check:doc-security-posture, check:doc-formula-expressions, check:i18n-stale-fill, check-skills-token-ratchet, check:doc-anchors, check:doc-authoring, check-affected-docs, check:spec-docblock-symbol-anchors, check:issue-citations, check-empty-changeset, check:docs-spec-enumerations, check-changeset-no-major (pre mode).
  • Red, expected: check-adr-0087-registration (the id registers with the 19 entry).
  • Red, outside this surface: check:adr-symbol-anchors on docs/adr/0066-unified-authorization-model.md:146, which anchors effective-object-permissions.ts#superuserFieldVote. docs/adr/** is out of this PR's surface; the anchor re-points to #viewAllFieldsReadVote with the ADR-0066 note below.
  • Red, not from this diff: check:platform-checklist (areas/automation.json anchors FlowItemMoreMenu.tsx#FlowItemMoreMenu; neither file is touched here).

Clause-②: yes (narrowing)
Metadata-protocol: semantic

Skills-docs: follow-up owed outside this PR's surface (skills/**): skills/objectstack-ai/SKILL.md (pitfall 2 says Modify All grants a field edit) and skills/objectstack-data/evals/hooks-security-seeds-datasources.json (an expected output says View All and Modify All re-open a field).

ADR-0066 D2 ⑧ end-state note (text for the weekly ADR card #37245)

Note (19.0.0): View All and Modify All cast no field vote (#36055, step 3 of the field-axis split #34365, ruling of record 6912661484). A set's viewAllRecords or modifyAllRecords on an object widens which records it reaches and casts no vote in either field merge. The one object-wide field vote is viewAllFields: readable: true on every field of the object, never editable: true, and a set's own explicit readable: false row on a field beats its own bit (the note of 2026-11-15, now carried by viewAllFields alone). Both merges ask one function, packages/core/src/security/effective-object-permissions.ts#viewAllFieldsReadVote. Consequences: a set's own field rows bind beside its own View All or Modify All; another set's View All or Modify All re-opens no hidden or locked field; nothing re-opens a field edit lock across sets (the built-in admin sets read every field through their '*' viewAllFields and no longer edit a field another held set locks). The ADR-0087 conversion permission-view-all-fields-beside-record-bypass adds viewAllFields: true beside the bits in source; it is a default flip, refused by id at the artifact door and at stored-row reads, so stored sets take this meaning on upgrade (ruling A on #36055). security-superuser-field-mask-inert is retired; security-cross-set-field-reopen reports the viewAllFields re-open only.

Follow-ups to file

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done (the post-feat(spec)!: PROTOCOL_VERSION 18 → 19, and every current-protocol handshake reads '^19' #37314 half is still owed).

🤖 Generated with Claude Code

https://claude.ai/code/session_011y7As8b4YLdvodeGAQWNTQ

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 6 package(s): @objectstack/core, @objectstack/lint, @objectstack/metadata-core, @objectstack/plugin-security, @objectstack/scenarios, @objectstack/spec, touching 49 documentable anchor(s). ⚠️ 5 changed file(s) yielded no anchor (packages/core/src/security/index.ts, packages/lint/src/index.ts, packages/plugins/plugin-security/src/agent-ceiling-clamp.ts, …), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

20 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 411646562566a1e12b4e0fc3de256192e8302719.

⛔ 7 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 5 changed file(s) yielded no anchor (packages/core/src/security/index.ts, packages/lint/src/index.ts, packages/plugins/plugin-security/src/agent-ceiling-clamp.ts, …) — pages documenting those are invisible to this run
  • 15 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 186 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 411646562566a1e12b4e0fc3de256192e8302719 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 9bab6c4e4b15546e3ee3a39a1426191e5dd8f22c — the merge of head bad558d574b997d7bc271793693fab55085331a4 into base 411646562566a1e12b4e0fc3de256192e8302719, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 9bab6c4e4b15546e3ee3a39a1426191e5dd8f22c && git checkout 9bab6c4e4b15546e3ee3a39a1426191e5dd8f22c
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 411646562566a1e12b4e0fc3de256192e8302719 bad558d574b997d7bc271793693fab55085331a4 && git checkout -B drift-repro 411646562566a1e12b4e0fc3de256192e8302719 && git merge --no-ff bad558d574b997d7bc271793693fab55085331a4

node scripts/docs-audit/affected-docs.mjs --json 411646562566a1e12b4e0fc3de256192e8302719

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 411646562566a1e12b4e0fc3de256192e8302719 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

…iew All and Modify All

ADR-0087 D2 entry permission-view-all-fields-beside-record-bypass, a default
flip retired from the load path: replayed by os migrate meta --from 18 only.
The stored-row seam and the artifact door refuse it by id, so stored sets
take the 19 meaning. Step 19 graduates it and carries the semantic entry
permission-view-all-modify-all-cast-no-field-vote with the one-step check.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As8b4YLdvodeGAQWNTQ
…ll default flip by id

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As8b4YLdvodeGAQWNTQ
… access-matrix snapshot

The showcase build's ADR-0090 D6 drift check named five grants this branch
added by hand (showcase_auditor on four objects, showcase_ops on
showcase_announcement); the snapshot now records them for review.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As8b4YLdvodeGAQWNTQ

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants